package com.shangjinrong.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum BorrowerStatusEnum {
    NO_AUTH(0, "未认证"),
    AUTH_RUN(1, "认证中"),
    AUTH_OK(2, "认证成功"),
    AUTH_FAIL(-1, "认证失败");

    private Integer status;
    private String msg;

    public static String getMsgByStatus(Integer status) {
        BorrowerStatusEnum[] values = BorrowerStatusEnum.values();

        for (BorrowerStatusEnum borrowerStatusEnum : values) {
            if (borrowerStatusEnum.getStatus().equals(status)) {
                return borrowerStatusEnum.msg;
            }
        }

        return "";
    }

}
